package com.aspose.cells;

class zays {
   public static boolean a = true;

   static void a(zqa var0, byte[] var1) throws Exception {
      byte[] var2 = new byte[var1.length + 8];
      var2[0] = var2[4] = 100;
      var2[1] = var2[5] = 8;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.length + 4), 0, var2, 2, 2);
      System.arraycopy(var1, 0, var2, 8, var1.length);
      var0.a(var2);
   }

   static int a(byte[] var0, int var1, byte var2, byte var3, Object var4, double var5) {
      int var7;
      var7 = var1 + 1;
      var0[var1] = 100;
      var0[var7++] = 8;
      var7 += 2;
      var0[var7++] = 100;
      var0[var7++] = 8;
      var0[var7++] = 0;
      var0[var7++] = 0;
      var0[var7++] = var2;
      var0[var7++] = var3;
      byte var10;
      label48:
      switch(var2) {
      case 0:
         String var12;
         switch(var3) {
         case 0:
            if (var4 instanceof String) {
               var12 = (String)var4;
               System.arraycopy(com.aspose.cells.b.a.zc.a((short)var12.length()), 0, var0, var7, 2);
               System.arraycopy(com.aspose.cells.b.a.zc.a((int)0), 0, var0, var7 + 2, 4);
               var7 += 6;
               System.arraycopy(com.aspose.cells.b.a.zc.a((short)var12.length()), 0, var0, var7, 2);
               var7 += 2;
               var7 += zco.a(var0, var7, var12);
            }
            break label48;
         case 2:
            if (var4 instanceof PivotTable) {
               PivotTable var13 = (PivotTable)var4;
               var10 = 0;
               if (!var13.getEnableFieldList()) {
                  var10 = 1;
               }

               var0[var7++] = 4;
               var0[var7++] = (byte)(65 + (var10 << 2));
               var0[var7++] = 64;
               var7 += 3;
            }
            break label48;
         case 25:
            var0[var7++] = -97;
            var0[var7++] = 0;
            var0[var7++] = 64;
            var7 += 3;
            break label48;
         case 30:
            var7 += 6;
            var0[var7++] = 50;
            ++var7;
            if (var4 != null) {
               var12 = (String)var4;
               System.arraycopy(com.aspose.cells.b.a.zc.a((short)var12.length()), 0, var0, var7, 2);
               var7 += 2;
               byte[] var14 = Encoding.getUnicode().a(var12);
               System.arraycopy(var14, 0, var0, var7, var14.length);
               var7 += var14.length;
            } else {
               var7 += 2;
            }
            break label48;
         default:
            var7 += 6;
            break label48;
         }
      case 3:
         switch(var3) {
         case -1:
            var0[var7] = 0;
            var7 += 6;
            break label48;
         case 0:
            System.arraycopy(com.aspose.cells.b.a.zc.a((Integer)var4), 0, var0, var7, 4);
            var7 += 6;
            break label48;
         case 52:
            var0[var7] = 1;
            var7 += 6;
         default:
            break label48;
         }
      case 23:
         switch(var3) {
         case 25:
            if (var4 instanceof PivotField) {
               PivotField var9 = (PivotField)var4;
               var10 = 0;
               if (!var9.isIncludeNewItemsInFilter()) {
                  var10 = 1;
               }

               byte var11 = 0;
               if (var9.getShowCompact()) {
                  var11 = 1;
               }

               var0[var7++] = (byte)((var11 << 3) + (var10 << 5));
               var7 += 5;
            } else {
               var7 += 6;
            }
         }
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a((short)(var7 - var1 - 4)), 0, var0, var1 + 2, 2);
      return var7 - var1;
   }

   static int a(byte var0, byte var1, Object var2) {
      int var3 = 10;
      switch(var0) {
      case 0:
         switch(var1) {
         case -1:
         case 2:
         case 25:
            var3 += 6;
            return var3;
         case 0:
            var3 += 8 + zakq.e((String)var2);
            return var3;
         case 30:
            if (var2 == null) {
               var3 += 10;
            } else {
               var3 += 10 + 2 * ((String)var2).length();
            }

            return var3;
         default:
            return var3;
         }
      case 3:
         var3 += 6;
         if (var1 == 2) {
            var3 += 16;
         }
         break;
      case 23:
         switch(var1) {
         case 25:
            var3 += 6;
         }
      }

      return var3;
   }

   static void a(zqa var0, PivotTable var1) throws Exception {
      a(var0, 0, 0, var1, (zauk)null, (PivotField)null);
      a(var0, 0, 2, var1, (zauk)null, (PivotField)null);
      a(var0, 0, 25, var1, (zauk)null, (PivotField)null);
      a(var0, 0, 30, var1, (zauk)null, (PivotField)null);
      a(var0, 0, 255, var1, (zauk)null, (PivotField)null);
   }

   static void a(zqa var0, zauk var1) throws Exception {
      a(var0, 3, 0, (PivotTable)null, var1, (PivotField)null);
      a(var0, 3, 52, (PivotTable)null, var1, (PivotField)null);
      a(var0, 3, 255, (PivotTable)null, var1, (PivotField)null);
   }

   static void a(zqa var0, int var1, int var2, PivotTable var3, zauk var4, PivotField var5) throws Exception {
      switch(var1) {
      case 0:
         switch(var2) {
         case -1:
            c(var0);
            return;
         case 0:
            a(var0, var3.getName());
            return;
         case 2:
            b(var0, var3);
            return;
         case 25:
            b(var0);
            return;
         case 30:
            b(var0, var3.getPivotTableStyleName());
            return;
         default:
            return;
         }
      case 3:
         switch(var2) {
         case -1:
            d(var0);
            return;
         case 0:
            a(var0, var4.r);
            return;
         case 52:
            a(var0);
            return;
         default:
            return;
         }
      case 23:
         switch(var2) {
         case 25:
            a(var0, var5);
            return;
         default:
            return;
         }
      default:
      }
   }

   static void a(zqa var0, PivotField var1) throws Exception {
      byte[] var2 = new byte[a((byte)23, (byte)25, (Object)null)];
      byte var3 = 0;
      int var10000 = var3 + a(var2, var3, (byte)23, (byte)25, var1, 0.0D);
      var0.a(var2);
   }

   static void a(zqa var0, String var1) throws Exception {
      byte[] var2 = new byte[a((byte)0, (byte)0, var1)];
      byte var3 = 0;
      int var10000 = var3 + a(var2, var3, (byte)0, (byte)0, var1, 0.0D);
      var0.a(var2);
   }

   static void a(zqa var0, int var1) throws Exception {
      byte[] var2 = new byte[a((byte)3, (byte)0, var1)];
      byte var3 = 0;
      int var10000 = var3 + a(var2, var3, (byte)3, (byte)0, var1, 0.0D);
      var0.a(var2);
   }

   static void a(zqa var0) throws Exception {
      byte[] var1 = new byte[a((byte)3, (byte)52, (Object)null)];
      byte var2 = 0;
      int var3 = var2 + a(var1, var2, (byte)3, (byte)52, (Object)null, 0.0D);
      var0.a(var1);
   }

   static void b(zqa var0, String var1) throws Exception {
      byte[] var2 = new byte[a((byte)0, (byte)30, var1)];
      byte var3 = 0;
      int var10000 = var3 + a(var2, var3, (byte)0, (byte)30, var1, 0.0D);
      var0.a(var2);
   }

   static void b(zqa var0, PivotTable var1) throws Exception {
      byte[] var2 = new byte[a((byte)0, (byte)2, (Object)null)];
      byte var3 = 0;
      int var10000 = var3 + a(var2, var3, (byte)0, (byte)2, var1, 0.0D);
      var0.a(var2);
   }

   static void b(zqa var0) throws Exception {
      byte[] var1 = new byte[a((byte)0, (byte)25, (Object)null)];
      byte var2 = 0;
      int var3 = var2 + a(var1, var2, (byte)0, (byte)25, (Object)null, 0.0D);
      var0.a(var1);
   }

   static void c(zqa var0) throws Exception {
      byte[] var1 = new byte[a((byte)0, (byte)-1, (Object)null)];
      byte var2 = 0;
      int var3 = var2 + a(var1, var2, (byte)0, (byte)-1, (Object)null, 0.0D);
      var0.a(var1);
   }

   static void d(zqa var0) throws Exception {
      byte[] var1 = new byte[a((byte)3, (byte)-1, (Object)null)];
      byte var2 = 0;
      int var3 = var2 + a(var1, var2, (byte)3, (byte)-1, (Object)null, 0.0D);
      var0.a(var1);
   }
}
